<html>
<head><meta charset="utf-8"><title>Creating a test with a dependency · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html">Creating a test with a dependency</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="210040391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210040391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bram van den Heuvel <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210040391">(Sep 14 2020 at 17:53)</a>:</h4>
<p>Some open issues ask for a test but use an external crate. How should one go about creating a test for such an issue?</p>
<p>Should it essentially be an MCVE, requiring one to potentially spend a lot of time boiling down this external crate code? Or is it acceptable to introduce a dependency?</p>



<a name="210040778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210040778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210040778">(Sep 14 2020 at 17:56)</a>:</h4>
<p>do you have a specific issue in mind rn?</p>



<a name="210040937"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210040937" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210040937">(Sep 14 2020 at 17:57)</a>:</h4>
<p>i personally believe that using extern crates in tests should be avoided in nearly all cases. They increase the build time of the test and make it less clear what exactly this test is testing</p>



<a name="210041123"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210041123" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> davidtwco <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210041123">(Sep 14 2020 at 17:59)</a>:</h4>
<p>rustc tests don't depend on other ecosystem crates, but can depend on other Rust source files (sometimes that's necessary). If an extern crate is required for reproduction, then both the code that ICEs and the dependency need minimized.</p>



<a name="210042771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210042771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bram van den Heuvel <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210042771">(Sep 14 2020 at 18:12)</a>:</h4>
<p><span class="user-mention silent" data-user-id="216206">lcnr</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Creating.20a.20test.20with.20a.20dependency/near/210040778">said</a>:</p>
<blockquote>
<p>do you have a specific issue in mind rn?</p>
</blockquote>
<p><a href="https://github.com/rust-lang/rust/issues/54899">#54899</a></p>



<a name="210043705"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210043705" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210043705">(Sep 14 2020 at 18:20)</a>:</h4>
<p>ok, hmm</p>
<p>That test is using <code>feature(existential_type)</code> which has been removed in favor of <code>#![feature(type_alias_impl_trait)]</code></p>



<a name="210047039"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210047039" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bram van den Heuvel <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210047039">(Sep 14 2020 at 18:48)</a>:</h4>
<p>I know, but I thought that the test could still be useful, not? It is easy to rewrite the code.</p>



<a name="210047149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210047149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bram van den Heuvel <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210047149">(Sep 14 2020 at 18:49)</a>:</h4>
<p>I guess that one could easily create a test that does something like this old bug, I'm just not sure to which extent one could recreate an MCVE and how useful that would be</p>



<a name="210047165"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210047165" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bram van den Heuvel <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210047165">(Sep 14 2020 at 18:49)</a>:</h4>
<p>If not, I guess it should be closed</p>



<a name="210047335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210047335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210047335">(Sep 14 2020 at 18:50)</a>:</h4>
<p>yeah, I think it might make sense to just close that issue</p>



<a name="210054899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210054899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Bram van den Heuvel <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210054899">(Sep 14 2020 at 19:54)</a>:</h4>
<p>Okay, could you do that?</p>



<a name="210055433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Creating%20a%20test%20with%20a%20dependency/near/210055433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Creating.20a.20test.20with.20a.20dependency.html#210055433">(Sep 14 2020 at 19:59)</a>:</h4>
<p>done <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span> thanks for looking at this anyways</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>